import { commonParams } from './config.js'
//推荐页的幻灯片
export function getRecommend(callback) {
  const data = Object.assign({},commonParams,{
    platform: 'h5',
    uin: 0,
    needNewCode: 1
  });
  wx.request({
    url: 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg',
    data: data,
    header: {
      'Content-Type': 'application/json'
    },
    success(res) {
      if (res.statusCode == 200) {
        callback(res.data)
      }else{}
    }
  })
}
//推荐歌单
export function getDiscList(callback){
  const data = Object.assign({}, commonParams, {
    platform: 'yqq',
    hostUin: 0,
    sin: 0,
    ein: 29,
    sortId: 5,
    needNewCode: 0,
    categoryId: 10000000,
    rnd: Math.random(),
    format: 'json'
  });
  wx.request({
    url: 'https://luoyan.haletone.club/api/getDiscList',
    data: data,
    header: {
      'Content-Type': 'application/json'
    },
    success(res){
      if (res.statusCode == 200) {
        callback(res.data)
      } else { }
    }
  })
}
